<!DOCTYPE html>
<html xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div id="queryDiv" class="queryDiv">
            <div class="grid-btn">
                <div class="form-group col-sm-2 keyword">
                    <input type="text" class="form-control" id="keyword" @keyup.enter="query"
                           placeholder="批次号/设备编号模糊查询">
                </div>
                <a class="btn btn-primary" @click="query">查询</a>

                #if($shiro.hasPermission("zwan/sysorderdeviceinfo:save"))
                <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
                #end
                <!--  #if($shiro.hasPermission("zwan/sysorderdeviceinfo:update"))
                  <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
                  #end-->
                #if($shiro.hasPermission("zwan/sysorderdeviceinfo:delete"))
                <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
                #end
                <!--  <a class="btn btn-primary" @click="updatedeviceid"><i class="fa fa-eye"></i>&nbsp;更新设备编号</a>-->
                <a class="btn btn-primary" @click="viewbind"><i class="fa fa-eye"></i>&nbsp;查看绑定</a>

                <a class="btn btn-primary" @click="bindcompany1"><i class="fa fa-handshake-o"></i>&nbsp;绑定公司</a>

                <a class="btn btn-primary" @click="setCC"><i class="fa fa-phone"></i>&nbsp;配置一键呼叫号码</a>
            </div>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading" style="display: block">{{title}}</div>
        <form class="form-horizontal"  id="addform">
            <div class="form-group">
                <div class="col-sm-2 control-label">设备供应商</div>
                <div class="col-sm-10 ">

                    <select id="vendor" type="text" class="form-control validate[required]"
                            v-model="sysorderdeviceinfo.vendorcode">
                        <option v-for="option in vendors" v-bind:value="option.vendorCode">
                            {{ option.vendorName }}
                        </option>
                    </select>
                </div>
            </div>


            <!--  <div class="form-group">
                  <div class="col-sm-2 control-label">设备类型</div>
                  <div class="col-sm-10">
                      <select type="text" class="form-control js-example-basic-single" v-model="sysorderdeviceinfo.devicetype">
                          <option value="301">智能眼镜</option>
                          <option value="302">观看端</option>
                      </select>

                  </div>
              </div>-->
            <div class="form-group">
                <div class="col-sm-2 control-label">设备编码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control js-example-basic-single validate[required]"
                           v-model="sysorderdeviceinfo.deviceid" placeholder=""/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">备注</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control js-example-basic-single validate[required]"
                           v-model="sysorderdeviceinfo.devicedesc" placeholder=""/>
                </div>
            </div>


            <div class="form-group">
                <div class="col-sm-2 control-label">设备状态</div>
                <div class="col-sm-10">
                    <select type="text" class="form-control js-example-basic-single"
                            v-model="sysorderdeviceinfo.devicestatus">
                        <option value="0">待测试</option>
                        <option value="2">返厂维修</option>
                        <option value="6">在网运行</option>
                        <option value="7">报废</option>
                    </select>

                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>


    <!-- 模态框（Modal） -->
    <div class="modal fade" id="bindcompanymodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true">
        <div class="modal-dialog" style="width: 1000px;height: 600px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="bindcompanymodalLabel">选择公司</h4>
                </div>
                <div class="modal-body">
                    <div class="form-group">
                        <select id="companylists" class="form-control ">
                            <!-- <option v-for="company in companyList" v-bind:value="company.COMPANYID">
                                 {{ company.COMPANYNAME }}
                             </option>-->
                        </select>

                    </div>


                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" @click="activeDevice"><i
                            class="fa fa-plus-circle"></i>&nbsp;绑定
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i
                            class="glyphicon glyphicon-arrow-left"></i>&nbsp;返回
                    </button>

                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>

    <!-- 模态框（Modal） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog" style="width: 1000px;height: 600px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalLabel">绑定公司</h4>
                </div>
                <div class="modal-body">
                    <form class="form-horizontal">
                        <div class="form-group">
                            <div class="col-sm-2 control-label">公司名称</div>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" v-model="bindcompany.COMPANYNAME"
                                       readonly="readonly"/>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-2 control-label">公司名称</div>
                            <div class="col-sm-10">
                                <input type="text" class="form-control" v-model="bindcompany.COMPANYID"
                                       readonly="readonly"/>
                            </div>
                        </div>
                    </form>

                </div>

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-undo"></i>&nbsp;返回
                    </button>

                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>


    <!-- 模态框（Modal） -->
    <div v-show="bindmodal" class="modal fade" id="ccModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
         aria-hidden="true" data-width="1000px">
        <div class="modal-dialog" style="width: 1000px;height: 600px">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="ccModalLabel">配置一键呼叫</h4>
                </div>
                <div class="modal-body">

                    <div class="grid-btn">
                        <div class="form-group col-sm-2 keyword">
                            <input type="text" class="form-control" id="keywordCC" @keyup.enter="queryCC"
                                   placeholder="设备编号/批次号">
                        </div>
                        <a class="btn btn-primary" @click="queryCC">查询设备</a>


                    </div>


                    <!-- Table -->
                    <table id="jqGridCC" class="table table-striped">


                    </table>
                    <div id="jqGridPagerCC"></div>

                </div>
                <div class="modal-footer">
                    <!--
                                        <button type="button" class="btn btn-primary" @click="addbind"><i class="fa fa-plus-circle"></i>&nbsp;添加设备</button>
                    -->
                    <button type="button" class="btn btn-primary" @click="bindCC"><i class="fa fa-plus-circle"></i>&nbsp;确定
                    </button>
                    <button type="button" class="btn btn-default" data-dismiss="modal"><i
                            class="glyphicon glyphicon-arrow-left"></i>&nbsp;返回
                    </button>

                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>

</div>


<script src="${rc.contextPath}/js/zwan/sysorderdeviceinfo/sysorderdeviceinfo.js?_${date.systemTime}"></script>
</body>
</html>